import React, { Component } from 'react'
import store from '../store'

export default class Home extends Component {
    
    add = () => {
        store.dispatch({ type: "ADD" })
    }
    del = () => {
        store.dispatch({ type: "DEL" })
    }
    render() {
        return (
            <div>
                <h3>
                    我是Home组件 --- 
                </h3>
                <button onClick={() => {
                    this.del()
                }}>--</button>
                { store.getState().count }
                <button onClick={() => {
                    this.add()
                }}>++</button>
            </div>
        )
    }
}
